package com.wtb.javatool.service.impl;


import com.wtb.javatool.dao.CourseMapper;
import com.wtb.javatool.dao.DishMapper;
import com.wtb.javatool.entity.Course;
import com.wtb.javatool.entity.Dish;
import com.wtb.javatool.entity.Resource;
import com.wtb.javatool.service.ICourseService;
import com.wtb.javatool.service.IDishService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CourseService implements ICourseService {
	
	
	@Autowired
	private CourseMapper courseMapper;
	
	/**
	 * 添加课程
	 * @param course
	 */
	public Integer save(Course course) {
		return courseMapper.save(course);
	}

	/**
	 * 修改课程
	 * @param course
	 */
	public Integer update(Course course) {
		return courseMapper.update(course);
	}
	/**
	 * 列出所有课程
	 * @return
	 */
	public List<Course> listAll(){
		return courseMapper.listAll();
	}


	/**
	 * 根据ID删除某个课程
	 * @return
	 */
	public Integer delete(Integer id) {
		return courseMapper.delete(id);

	}

	/**
	 * 根据课程名称模糊搜索课程信息
	 * @param course_name
	 * @return
	 */
	@Override
	public List<Course> selectCourseByName(String course_name) {
		return courseMapper.selectCourseByName(course_name);
	}




}
